<?php
class Foxsis_Plugins_Auth extends Zend_Controller_Plugin_Abstract {
	
	public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request) 
	{
		if($request->getControllerName() != 'auth')
		{
			if ( !Zend_Auth::getInstance()->hasIdentity()) 
			{
				$redirect = Zend_Controller_Action_HelperBroker::getHelper('Redirector');
				
	            return $redirect->goToRoute( array('controller' => 'auth'), null, true);
	        }
		}
	}
}